API Reference/api/user/api/user/[id]

/api/user/[id]

Info
Info

Requires administrator privileges

URL Parameters

Field NameTypeDescription
idnumberThe id of the user to get

GET
Get a user

200
Ok (JSON)

Returns a user object.

{
"id": 1,
"username": "administrator",
"avatar": "data:image/png;base64",
"token": "LxWko2S4LSoxTyZZKsGhS6D4.MTY1OTQ1NzMwNzk2NQ",
"administrator": true,
"superAdmin": true,
"systemTheme": "system",
"embed": {},
"ratelimit": null,
"totpSecret": null,
"domains": []
}

404
Not Found (JSON)

  • user not found - The user you are trying to access does not exist.

PATCH
Update a user

Body (JSON)

Field nameTypeDescription
passwordstringUpdate the password, the password supplied will be hashed and stored.
usernamestringUpdate the username.
avatarstringMust be a base64 encoded image, if invalid it may be displayed incorrectly.
embedTitlestringUpdate the embed title used on OG tags
embedColorstringUpdate the embed color used on OG tags
embedSiteNamestringUpdate the embed site name used on OG tags
systemThemestringUpdate the user's theme, this will change the theme on the frontend, if a invalid theme is specified the frontend will default to the system theme.
domainsstring[]Update the user's domains. These domains are used to to provide random domains when uploading files.
administratorbooleanUpdate the user's administrator status.

200
Ok (JSON)

Returns a user object.

400
Bad Request (JSON)

  • username is already taken - The username you are trying to use is already taken.
  • invalid domains - The domains you are trying to use are invalid. Extra fields: .invalidDomains

401
Forbidden (JSON)

  • cannot modify administrator - You cannot modify the administrator user if you are not a superAdmin.
Last updated: 3/23/2023
Edit this page on GitHub